<?php

class HTML_ECJC_LANG {

 function pages($total,$pagesets,$search,$pageNavSP, $language, $availlangs) {
 ?>
 <form action="index2.php" method="post" name="adminForm" class="adminForm" id="adminForm">
 <input type="hidden" name="option" value="com_ecjc_lang">
 <input type="hidden" name="task" value="">
    <table class="adminheading" border="0">

   <tr>

      <th class="cpanel">ECJC Online Store Language Manager </th>

   </tr>
   <tr><th nowrap align="right">Show::<?php echo $pageNavSP->writeLimitBox(); ?></th><th nowrap align="center">Search::<input type="text" name="search" value="<?php echo $search;?>" class="inputbox" onChange="document.adminForm.submit();" /></th><th nowrap align="right">Language:: <select name=language onChange="document.adminForm.submit();" /><?php
   while($lngs = mysql_fetch_array($availlangs)){
   echo '<option ';
   if ($language == $lngs['directory']) {
   echo ' Selected ';
   }
   echo '>'.$lngs['directory'].'</option>';
   
   
   }?></select></th></tr>

   </table>
   <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminform">
         <tr>
			<th width="15">#</th>
			<th width="125">Page</th>
			<th width="20"></th>
			<th width="15">#</th>
			<th width="125">Page</th>
			<th width="*"></th>
		</tr>
   
   <?php
   $c = 0;
   while ($lpage = mysql_fetch_array($pagesets)){
   $c = 1 - $c;
   if ($c == 1) {
   echo '<tr>';
   }else{
   echo '<td></td>';
   }
  echo '<td></td><td><a href="index2.php?option=com_ecjc_lang&task=editpage&lpage='.$lpage['lpage'].'">'.$lpage['lpage'].'</a></td></td></td>';
  if ($c == 0) {
  echo '</tr>';
  }
   
   }
   ?>
   <tr align="center">

         <th align="center" colspan="6">

            <?php echo $pageNavSP->writePagesLinks(); ?></th>

      </tr>

      <tr>

         <td align="center" colspan="6">

            <?php echo $pageNavSP->writePagesCounter(); ?></td>

      </tr>
   
   <?php
 
 
 }//pages
 function values($total,$pagecont,$search,$pageNavSP, $language, $availlangs) {
 ?>
 <form action="index2.php" method="post" name="adminForm" class="adminForm" id="adminForm">
 <input type="hidden" name="option" value="com_ecjc_lang">
 <input type="hidden" name="task" value="editpage">
 <input type="hidden" name="lpage" value="<?php echo $_REQUEST['lpage'];?>">
    <table class="adminheading" border="0">

   <tr>

      <th class="cpanel">ECJC Online Store Language Manager - <?php echo $_REQUEST['lpage']; ?></th>

   </tr>
   <tr><th nowrap align="right">Show::<?php echo $pageNavSP->writeLimitBox(); ?></th><th nowrap align="center">Search::<input type="text" name="search" value="<?php echo $search;?>" class="inputbox" onChange="document.adminForm.submit();" /></th><th nowrap align="right">Language:: <select name=language onChange="document.adminForm.submit();" /><?php
   while($lngs = mysql_fetch_array($availlangs)){
   echo '<option ';
   if ($language == $lngs['directory']) {
   echo ' Selected ';
   }
   echo '>'.$lngs['directory'].'</option>';
   
   
   }?></select></th></tr>

   </table>
   <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminform">
   <tr>
		<th width="5">#</td>
		<th width="150">Language Key</th>
		<th width="*">Language Value</th>
	</tr>
	<?php 
	while ($pgcont = mysql_fetch_array($pagecont)){
	echo '<tr><td></td><td><a href="index2.php?option=com_ecjc_lang&task=editkey&key='.$pgcont['lkey'].'&lpage='.$_REQUEST['lpage'].'&language='.$language.'">'.$pgcont['lkey'].'</a></td><td>'.tep_db_output($pgcont['lvalue']).'</td></tr>';
	
	}?>
	<tr align="center">

         <th align="center" colspan="3">

            <?php echo $pageNavSP->writePagesLinks(); ?></th>

      </tr>

      <tr>

         <td align="center" colspan="3">

            <?php echo $pageNavSP->writePagesCounter(); ?></td>

      </tr>
   
   <?php
 
 }//values
 function editkey($keyval){
 ?>
 <form action="index2.php" method="post" name="adminForm" class="adminForm" id="adminForm">
 <input type="hidden" name="option" value="com_ecjc_lang">
 <input type="hidden" name="task" value="editkeyprocess">
 <input type="hidden" name="lpage" value="<?php echo $_REQUEST['lpage'];?>">
 <input type="hidden" name="language" value="<?php echo $_REQUEST['language'];?>">
 <input type="hidden" name="lkey" value="<?php echo $_REQUEST['key'];?>">
    <table class="adminheading" border="0">

   <tr>

      <th class="cpanel">ECJC Online Store Language Manager - <?php echo $_REQUEST['lpage']. ' - '. $_REQUEST['key']; ?></th>

   </tr>
   

   </table>
   <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminform">
   <tr>
   <td><textarea name="<?php echo $_REQUEST['key'];?>" rows="50" cols="100"><?php
   echo tep_db_output($keyval);?></textarea></td></tR>
 <?php
 }//editkey
 
 }//class
 
 ?>